package com.ssy.lingxi.transaction.controller.mobile;

import com.ssy.lingxi.common.controller.BaseController;
import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.transaction.api.dto.request.ProductQuotationDetailsRequest;
import com.ssy.lingxi.transaction.api.dto.request.ProductQuotationListRequest;
import com.ssy.lingxi.transaction.api.dto.response.ProductQuotationDetailsResponse;
import com.ssy.lingxi.transaction.api.dto.response.ProductQuotationListResponse;
import com.ssy.lingxi.transaction.service.IPlatformQuoteService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @menu 平台后台-询价报价-APP
 */
@RestController
@RequestMapping("/transaction/mobile")
public class MobilePlatformQuoteController extends BaseController {
    @Resource
    IPlatformQuoteService platformProductQuotationService;

    /**
     * 询价报价-报价单列表查询
     */
    @GetMapping("/platform/product/quotation/list")
    public Wrapper<PageData<ProductQuotationListResponse>> productQuotationList(ProductQuotationListRequest request, HttpServletRequest httpServletRequest) {
        UserLoginCacheDTO sysUser = this.getSysUser(httpServletRequest);
        return platformProductQuotationService.productQuotationList(request,sysUser);
    }

    /**
     * 询价报价-报价单详情
     */
    @GetMapping("/platform/product/quotation/details")
    public Wrapper<ProductQuotationDetailsResponse> productQuotationDetails(ProductQuotationDetailsRequest request, HttpServletRequest httpServletRequest) {
        UserLoginCacheDTO sysUser = this.getSysUser(httpServletRequest);
        return platformProductQuotationService.productQuotationDetails(request,sysUser);
    }

}
